<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html,
        body {
            margin: 0 auto;
            padding: 0;
            overflow: hidden;
        }


        #player {
            /* width: 600px;
            height: 400px; */
            background-color: lightblue;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="player"></div>
    <!-- <script src="./public/lib/player.js"></script> -->
    <script src="http://player.polyv.net/script/player.js"></script>
    <!-- <script src="http://www.besteasylearn.com/pic/polyvplayer_v2.0.min.js"></script> -->
    <script>
        function getUrlParamsMap() {
            var url = location.href; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substring(url.indexOf("?") + 1);
                var strs = str.split("&");
                for (var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }

        var key = getUrlParamsMap()['key'] || '';
        var autoplay = getUrlParamsMap()['autoplay'];
        // alert(autoplay)
        var width = getUrlParamsMap()['width'] || 1280;
        var height = getUrlParamsMap()['height'] || 765;

        var player = polyvPlayer({
            wrap: '#player',
            width: width,
            height: height,
            autoplay: autoplay == 1 ? true : 0,
            vid: key,
            loop: true
        });
    </script>
</body>

</html>